REPLICATION MATERIALS AND INSTRUCTIONS - The Impact of Natural Disasters on the Ongoing Civil War: the Role of Spatial Configuration of Territorial Control

This package contains all materials necessary to reproduce the analysis, figures, and tables from the main text and appendix of the paper. All data processing and statistical analyses were conducted using R.

SYSTEM INFORMATION
The following system information is provided to support reproducibility and troubleshooting:
	1. Operating System: macOS (Darwin)
	2. Release: 23.5.0
	3. Kernel Version: Darwin Kernel Version 23.5.0 (Wed May 1 20:16:51 PDT 2024)
	4. Machine Architecture: arm64
	5. Rstudio:  2023.09.1+494 Desert Sunflower (desktop)
	6. See more information in Session_packages.txt

CODE FILES
	1. Four .R scripts named as “data processing_*.R” are used to generate all analysis datasets. 
	2. Two .R scripts named as “figures and table_main*.R" are used to generate all figures and tables in the main text. 
	3. One .R script named as “figures and tables_appendix.R” is used to run all models and generate all figures and tables in the Appendix. 
	4. One .R script named as "EM-DAT.R" is used to generate the dataset on affected barangays affected by EM-DAT-based natural disasters.

DATA DESCRIPTION
The data files are organized into three categories: raw data, cleaned data, and final analysis data. 

Raw Data
The following raw data sources are used to construct the final analysis dataset:
	1./data/raw/Barangays/Barangays.shp: Spatial shapefile for barangays (from the Philippine Standard Geographic Code – PSGC)
	2./data/raw/Municipalities/Municipalities.shp: Spatial shapefile for municipalities
	3./data/raw/regions/gadm41_PHL_1.shp: Regional shapefile from GADM (used to generate Figure 4 in the main text)
	4./data/raw/bcms_incidentlevel.rds: Conflict event data from the Bangsamoro Conflict Monitoring System (BCMS)
	5./data/raw/CNN_Brgy_Affectation_2011-2014.csv: Data on NPA presence by barangay, excluding the ARMM region (see Rubin(2019) for details)
	6./data/raw/emdat_public_2022_10_18_query_uid-RK8Q95.csv: Data on the natural disaster event from EM-DAT

Cleaned Data(Ready for Merge)
Due to size limitations, some raw datasets are not included directly. Instead, cleaned versions are provided:
	1./data/analysis/rainfall_zonal stat for phl.csv: Precipitation deviations (z-values) at the barangay-month level in the Philippines. 
		a. Derived from the IMERG: Integrated Multi-satellitE Retrievals for GPM. 
		b. Downloaded from either https://gpm.nasa.gov/data/imerg or https://giovanni.gsfc.nasa.gov/giovanni/
	2./data/analysis/rainfall_zonal stat for phl_mun.csv: Precipitation deviations at the municipality-month level
	3./data/analysis/rainfall_zonal_stats_2011_2014_rainfall_concentraction.csv: Monthly rainfall concentration values
	4./data/analysis/EM-DAT Measure.csv: Disaster-affected barangays based on EM-DAT (geocoded)
	5./data/analysis/nightlight.csv: Yearly nightlight intensity at the barangay level 
		a. Derived from VIIRS Day/Night Band (DNB) onboard the Joint Polar-orbiting Satellite System (JPSS) satellites. 
		b. downloaded from https://eogdata.mines.edu/products/vnl/#daily
	6./data/analysis/davao_region.csv: List of barangays located in the Davao region

Final Analysis Dataset
These datasets are used for estimation in the main text and appendix:
	1./data/analysis/dataset1_oldschool.csv: Processed Dataset on shifts in territorial control (barangay-year level, no staggered adoption)
	2./data/analysis/dataset1_staggeredadoption.csv: Dataset on shifts in territorial control (barangay-year level, with staggered adoption)
	3./data/analysis/dataset2_oldschool.csv: Dataset on battle-related violence (barangay-month level, no staggered adoption)
	4./data/analysis/dataset2_staggeredadoption.csv: Dataset on battle-related violence (barangay-month level, with staggered adoption)
	5./data/analysis/dataset1_month.csv: Dataset on shifts in territorial control (barangay-month level, no staggered adoption)
	6./data/analysis/dataset1_month_staggeredadoption.csv: Dataset on shifts in territorial control (barangay-month level, with staggered adoption)
	7./data/analysis/dataset_mun_*_1.csv: Dataset on shifts in territorial control (municipality-year level, no staggered adoption) 
	8./data/analysis/dataset_mun_*_2.csv: Dataset on shifts in territorial control (municipality-year level, with staggered adoption design)

CODE INSTRUCTIONS
	•At the beginning of each .R script, set the working directory to the root Replication Files folder.
	•Variable names used in the scripts may differ from those in the manuscript. Please consult codebook.txt for a complete mapping between code variables and their labels as presented in the paper.

